import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'node:path'

// https://vitejs.dev/config/
export default defineConfig({
  base:'./',
  plugins: [
    vue()
  ],
  resolve: {
    alias: {
      '@': resolve(__dirname,'./src/')
    }
  },
  server: {
    hmr: {
      overlay: false
    },
    host: '127.0.0.1',
    port: 8080,
    proxy: {
      '/api': {
        target: 'http://119.23.255.123:9010',
        // changeOrigin: true,
        //path.replace写法生效
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
})
